package com.nmsl.controller;

import com.nmsl.domain.GyfPatient;
import com.nmsl.mapper.GyfPatientMapper;
import com.nmsl.util.R.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/pt")
@RestController
public class GyfPatientController {
    @Autowired
    private GyfPatientMapper gyfPatientMapper;


    //通过患者id查询患者的信息
    @GetMapping("/selectByPrimaryKey")
    public R selectByPrimaryKey(int selectByPrimaryKey){
        GyfPatient gyfPatient = gyfPatientMapper.selectByPrimaryKey(selectByPrimaryKey);
        if(gyfPatient != null){
            return R.ok(gyfPatient);
        }else{
            return R.fail("没有找到信息");
        }
    }
}
